package com.adou.second.day10;

import java.util.Random;
import java.util.Scanner;

/**
 * 猜数字
 * 1-100
 * @author ADou
 *
 */
public class RandomDemo {

	public static void main(String[] args) {
		start();
		
	}
	
	public static void start(){
		Random r = new Random();
		int number = r.nextInt(10)+1;
		
		while(true) {
			Scanner sc = new Scanner(System.in);
			System.out.println("请输入(10以内)gestNumber=");
			int gestNumber = sc.nextInt();
			
			if(gestNumber > number) {
				System.out.println("大了");
			} else if(gestNumber < number){
				System.out.println("小了");
			} else {
				System.out.println("恭喜你猜对啦");
				break;
			}
		}
	}

}
